﻿<%@ Page MasterPageFile="Site1.Master" Language="C#" AutoEventWireup="true" CodeBehind="EQ.aspx.cs" Inherits="EqRepair.Web.EQ" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMainContent" runat="server">
 
 



    <asp:GridView ID="GridView1" runat="server" AllowPaging="True"  
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
        DataKeyNames="Id" DataSourceID="LinqDataSource1" ForeColor="#333333" 
        GridLines="None" 
    onselectedindexchanged="GridView1_SelectedIndexChanged">
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:CommandField ButtonType="Button" SelectText="Декомпозиция" 
                ShowSelectButton="True" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="Id" HeaderText="Код" InsertVisible="False" 
                ReadOnly="True" SortExpression="Id" />
            <asp:BoundField DataField="Name" HeaderText="Наименование" 
                SortExpression="Name" />
            <asp:BoundField DataField="Description" HeaderText="Краткое описание" 
                SortExpression="Description" />
            <asp:BoundField DataField="LifeTime" HeaderText="Межремонтный ресурс в днях" 
               
                NullDisplayText="0" SortExpression="LifeTime" />
                
            <asp:BoundField DataField="RepairTime" HeaderText="Время ремонта(чел./час)" 
                NullDisplayText="0" SortExpression="RepairTime" />
            <asp:BoundField DataField="RepairCost" HeaderText="Стоимость ремонта" 
                NullDisplayText="0" SortExpression="RepairCost" />
            <asp:BoundField DataField="TTH" HeaderText="Полное описание" 
                SortExpression="TTH" />
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="EqRepair.Code.Data.DataClasses2DataContext" 
        EnableDelete="True" EnableInsert="True" EnableUpdate="True" 
        TableName="Equipments">
    </asp:LinqDataSource>
    <asp:Label ID="Label2" runat="server" Text="Добавление"></asp:Label>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
        DataKeyNames="Id" DataSourceID="LinqDataSource1" DefaultMode="Insert" 
        Height="50px" Width="428px" CellPadding="4" ForeColor="#333333" 
        GridLines="None" oniteminserting="DetailsView1_ItemInserting" 
    oniteminserted="DetailsView1_ItemInserted">
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
        <RowStyle BackColor="#EFF3FB" />
        <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                ReadOnly="True" SortExpression="Id" />
            <asp:BoundField DataField="Name" HeaderText="Наименование" 
                SortExpression="Name" />
            <asp:BoundField DataField="Description" HeaderText="Краткое описание" 
                SortExpression="Description" />
            <asp:BoundField DataField="LifeTime" HeaderText="Межремонтный ресурс в днях" 
                SortExpression="LifeTime" NullDisplayText="0" DataFormatString="{0:E2}" />
            <asp:BoundField DataField="RepairTime" HeaderText="Время ремонта (чел./час)" 
                SortExpression="RepairTime" NullDisplayText="0" 
                DataFormatString="{0:E2}" />
            <asp:BoundField DataField="RepairCost" HeaderText="Стоимость ремонта" 
                SortExpression="RepairCost" NullDisplayText="0" 
                DataFormatString="{0:E2}" />
            <asp:TemplateField HeaderText="Полное описание" SortExpression="TTH">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TTH") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TTH") %>' TextMode="MultiLine"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("TTH") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:DetailsView>
 
 



    </asp:Content>